<html ng-app="myApp"> <!-- 定义整个angulajs使用的上下文环境 -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>AngulaJs</title>
    <script type="text/javascript" src="angular/angular.js"></script>
</head>
<body>
<div ng-controller="myController">
    <h1>书名: {{book.title}}</h1>
    <h1>价格: {{book.price}}</h1>
    <h2>{{getInfo()}}</h2>
</div>
<script type="text/javascript">
    var app = angular.module("myApp",[]) ; // 定义模块
    app.controller("myController", function($scope){
       $scope.book = {
           title:'java',
           price:66.66
       } ;  // 控制器里定义的就是程序中要使用的内容
        // 此处要定义函数, 但所有的数据必须依靠$scope访问
        $scope.getInfo = function () {
            return "图书名称:" + $scope.book.title + ", 价格:" + $scope.book.price ;
        };
    });
</script>
</body>
</html>
